home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 13 April 1997
- //
- // Procedure Name:
- // RenShadersMenu
- //
- // Description:
- // Create the RENDERING->Shaders menu
- //
- // Input Arguments:
- // parent to parent the menu to.
- //
- // Return Value:
- // None.
- //
-
-
- // Procedure Name:
- // buildShadingGroupMenu
- //
- // Description:
- // Procedure to build the shading group assign menu.
- //
- global proc buildShadingGroupMenu( string $parent )
- {
- setParent -m $parent;
- menu -e -dai $parent;
-
- string $sets[] = `ls -sets`;
- for ( $set in $sets ) {
- if (`sets -q -renderable $set`) {
- menuItem -l $set
- -annotation ("Assign Shading Group " + $set + ": Select surfaces / polygons")
- -c ( "assignShadingGroup " + $set );
- menuItem -ob true
- -annotation ($set + " Option Box")
- -l ($set + " Option Box")
- -c ( "showEditor " + $set );
- }
- }
- }
-
- global proc refreshShadingMenu( string $parent )
- {
- setParent -m $parent;
-
- string $activeList[] = `selectionConnection -query -object activeList`;
-
- if (size($activeList) == 1)
- {
- menuItem -edit -enable true
- RenLightingSelectObjectsItem;
- menuItem -edit -enable true
- RenLightingSelectLightsItem;
- }
- else
- {
- menuItem -edit -enable false
- RenLightingSelectObjectsItem;
- menuItem -edit -enable false
- RenLightingSelectLightsItem;
- }
-
- int $mentalIsLoaded = 0;
- string $renderer;
- for ($renderer in `renderer -query -namesOfAvailableRenderers`) {
- if( $renderer == "mentalRay" ) {
- $mentalIsLoaded = 1;
- break;
- }
- }
- menuItem -edit -enable $mentalIsLoaded assignNewBakeSetItem;
- menuItem -edit -enable $mentalIsLoaded assignExistingBakeSetItem;
- menuItem -edit -enable $mentalIsLoaded batchBakeItem;
- menuItem -edit -enable $mentalIsLoaded batchBakeOptionsItem;
- }
-
- global proc RenShadersMenu( string $parent )
- {
- setParent -m $parent;
- if( `menu -q -ni $parent` != 0 ) {
- //
- // Menu is built already, just refresh it.
- //
- refreshShadingMenu($parent);
- return;
- }
-
- // After the first post builds the menu, change the
- // post command to refresh the menus items.
- //
- menu -edit
- -postMenuCommand ("refreshShadingMenu " + $parent)
- -postMenuCommandOnce false
- $parent;
-
- menuItem -l "Material Attributes..."
- -annotation "Material Attributes: Select Object to edit its shading attributes"
- -c "ShowShadingGroupAttributeEditor";
-
- menuItem -d true;
-
- buildShaderMenus("");
-
- menuItem -d true;
-
- buildBakingMenus("");
-
- menuItem
- -label "Batch Bake (mental ray)"
- -annotation "Batch Bake: Bake lighting/shading to file textures or vertex data."
- -command "mrBakeToTexture false false"
- batchBakeItem;
-
- menuItem
- -optionBox true
- -label "Batch Bake Option Box"
- -annotation "Batch Bake Option Box"
- -command "mrBakeToTexture true false"
- batchBakeOptionsItem;
-
- menuItem -d true;
-
- menuItem
- -label "Make Light Links"
- -annotation "Make Light Links: Make light links between selected lights and selected objects"
- -command "MakeLightLinks";
-
- menuItem
- -label "Break Light Links"
- -annotation "Break Light Links: Break light links between selected lights and selected objects"
- -command "BreakLightLinks";
-
- menuItem
- -label "Select Objects Illuminated by Light"
- -annotation "Select Objects Illuminated by Light: Select the objects illuminated by the currently selected light"
- -command "SelectObjectsIlluminatedByLight"
- RenLightingSelectObjectsItem;
-
- menuItem
- -label "Select Lights Illuminating Object"
- -annotation "Select Lights Illuminating Object: Select the lights illuminating the currently selected object"
- -command "SelectLightsIlluminatingObject"
- RenLightingSelectLightsItem;
-
- string $menu = `menuItem -l "Light Linking" -sm true -to true`;
- menu -e -pmc ( "buildLightLinkingEdMenu " + $menu ) $menu;
-
- setParent -m ..;
-
- refreshShadingMenu($parent);
- }
-